package com.cloudfun.campusshare.entity;

import com.cloudfun.campusshare.common.constant.RoleType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * Created by Huqin on 2019/12/23
 */
@Data
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "role")
public class RoleEntity extends CreatorPersistenceEntity {

    @Id
    @GenericGenerator(name = "id_uuid", strategy = "uuid")
    @GeneratedValue(generator = "id_uuid")
    @Column(unique = true, columnDefinition = ("varchar(40) not null comment '主键uuid'"))
    private String id;

    @Column(columnDefinition = ("varchar(32) default null comment '角色类型'"))
//    @Enumerated(EnumType.STRING)
    private String type;

    @Column(unique = true, columnDefinition = ("varchar(64) not null comment '角色名'"))
    private String name;

    @Column(columnDefinition = ("varchar(64) not null comment '角色描述'"))
    private String description;

    @Column(columnDefinition = ("tinyint(1) not null comment '是否能查看所有数据。否则只能查看账号及其子账号数据'"))
    private Boolean viewAllData;

    @Column(columnDefinition = ("tinyint(1) not null comment '启用'"))
    private Boolean enable;

    @Column(columnDefinition = ("varchar(40) not null comment '商家id'"))
    private String merchantId;

}
